string->keyword

kw


Summary

Convert a string into a keyword

Arguments

kw
The input string

Return value

Returns the keyword for kw

Examples

(string->keyword "asd")
:asd

Bytecode

Probably only interesting to you if you want to understand more about the Nujel VM or care very much about performance.

(    0 ($push/val :string))
(    2 ($get/val 'type-of))
(    4 ($get/val 'kw))
(    6 ($apply 1))
(    8 ($=))
(    9 ($jf* 7))
(   12 ($push/nil))
(   13 ($jmp* 21))
(   16 ($get/val 'throw))
(   18 ($get/val 'list))
(   20 ($push/val :type-error))
(   22 ($push/val (string->keyword) can only be called on strings))
(   24 ($get/val 'kw))
(   26 ($get/val 'current-lambda))
(   28 ($apply 0))
(   30 ($apply 4))
(   32 ($apply 1))
(   34 ($drop))
(   35 ($get/val 'symbol->keyword))
(   37 ($get/val 'string->symbol))
(   39 ($get/val 'kw))
(   41 ($apply 1))
(   43 ($apply 1))
(   45 ($ret))

Related